#include "framework.h"
#include <stdio.h>
								
								
#define AD_CHANNEL_INTERNAL_BOND_GAP								8								

#if defined(NUVOTON)
	//use uart0
	//#define USER_CONFIG()												MODIFY_HIRC_166();P06_PushPull_Mode();P07_Input_Mode();//initialize RXD & TXD PINS.
	
	//use uart1
	#define USER_CONFIG()												MODIFY_HIRC_166();P16_PushPull_Mode();P02_Input_Mode();//initialize RXD_1 & TXD_1 PINS.
#elif defined(STC)
	#define USER_CONFIG()											
#elif defined(SINONE)
	#define USER_CONFIG()											
#endif



char putchar (char ch)
{
	uart1_write(&ch, sizeof(ch));
	return ch;
}


void main(void)
{
	USER_CONFIG();
	uart1_init(115200, 0, 0);
	AD_Power_On();
	INTERRUPT_ENABLE();

	for(;;)
	{
		printf("ad:%d\r\n", AD_Convert(AD_CHANNEL_INTERNAL_BOND_GAP));
	}
}


